﻿$(document).ready(function () {
    $("#UpgradeVIP").click(function () {
        $(this).after("<span id='loading' style='margin-left:5px'><img src='../images/loading_fb.gif' alt='loading...' /></span>");
        $.ajax({
            type: "POST",
            url: "../ajax/UpgradeVIP.ashx",
            success: function (responseText) {
                $("#loading").remove();
                if (responseText == 1) {
                    alert("Nâng cấp thành công.");
                    window.open(location.reload(true));
                }
                else if (responseText == -1) {
                    alert('Lỗi.');
                }
            }
        });
        return false;
    });
});